package shipin.main;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class Utils {

	private String propertyFileName;
    private ResourceBundle resourceBundle;
    private Utils() {
    	//params.properties
        propertyFileName = "params";
        resourceBundle = ResourceBundle.getBundle(propertyFileName);
    }
    private static Utils instance;
    public static Utils getInstance(){
    	if(instance == null){
    		instance = new Utils();
    	}
    	return instance;
    }
    public String getString(String key) {
        if (key == null || key.equals("") || key.equals("null")) {
            return "";
        }
        String result = "";
        try {
            result = resourceBundle.getString(key);
        } catch (MissingResourceException e) {
            e.printStackTrace();
        }
        return result;
    }
}
